package com.lh.java.basic.grammer;


class Gizmo {
	public int a;
	public void spin() {
		System.out.println("hi i am span");
	}
}

public class FinalArguments {
	void with(final Gizmo g) {
		g.a=5;
		System.out.println(g.a);
		// ! g = new Gizmo(); // Illegal -- g is final
	}

	void without(Gizmo g) {
		g = new Gizmo(); // OK -- g not final
		System.out.println(g.a);
		g.spin();
	}

	// void f(final int i) { i++; } // Can't change
	// You can only read from a final primitive:
	int g(final int i) {
		return i + 1;
	}

	public static void main(String[] args) {
		Gizmo a = new Gizmo();
		FinalArguments bf = new FinalArguments();
		bf.without(a);
		bf.with(a);
	}
} //